package es.deusto.ingenieria.aike.formulation;

import es.deusto.ingenieria.aike.search.heuristic.EvaluationFunction;
import es.deusto.ingenieria.ingenieria.search.Node;

public class Heuristic extends EvaluationFunction{

	@Override
	public double calculateG(Node arg0) {
		return 0;
	}

	@Override
	public double calculateH(Node nodo) {
		
		parkingState pState=(parkingState) nodo.getState().getInformacion();
		
		int carRow=pState.getCarPosRow();
		int carCol=pState.getCarPosCol();
		int flagRow= pState.getFlagRow();
		int flagCol= pState.getFlagCol();
		
		return (double)(Math.abs(flagRow-carRow)+Math.abs(flagCol-carCol));
		
	}

}
